<template>
    <div class="container">
        <guestMain v-if="zhihuUserInfo == null"></guestMain>
        <authMain v-if="zhihuUserInfo != null"></authMain>
    </div>
</template>

<script>
    import guestMain from '../components/guestMain'
    import authMain from '../components/authMain'
    import {
        isNull
    } from '../util/util'
    import {
        getToken
    } from '../util/auth'
    export default {
        data() {
            return {
                zhihuUserInfo: null,
            }
        },
        components: {
            guestMain,
            authMain
        },
        created() {
            if (localStorage.getItem('zhihuUserInfo') && localStorage.getItem('zhihuUserInfo') !== 'null' && getToken()) {
                this.zhihuUserInfo = JSON.parse(localStorage.getItem('zhihuUserInfo'))
            }
        }
    }
</script>
<style scoped>
    
</style>
